<%-- 
    Document   : exito
    Created on : 29-oct-2011, 14:07:06
    Author     : Juan Lucas
--%>

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>

<%@page import="docmanager.business.objects.Usuario"%>

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
        <title>Menu Principal</title>


	<style type="text/css">
	
	body{
		font-size:0.8em;
		font-family: Trebuchet MS, Lucida Sans Unicode, Arial, sans-serif;
		margin:0px;
		padding:0px;
	}
	img{
		border:0px;
	}
	thead td{
		font-weight:bold;
		color:#000;
		background-color:#E2EBED;
	}
	td{
		padding:2px;
	}
	table{
		border:1px solid #000;
		border-collapse: collapse;
	}
	h1{
		font-size:1.3em;
		margin-bottom:0px;
	}
	table,h1,p,#ads{
		margin-left:10px;
	}
	#ads{
		margin-top:20px;
	}
	
	/* These classes are used by the script as rollover effect for table 1 and 2 */
	
	.tableRollOverEffect1{
		background-color:#A0D0A0;
		color:#FFF;
	}
	
	.tableRowClickEffect1{
		background-color:#F00;
		color:#FFF;
	}
	
	</style>
	<script type="text/javascript">
	/************************************************************************************************************
	(C) www.dhtmlgoodies.com, November 2005
	
	This is a script from www.dhtmlgoodies.com. You will find this and a lot of other scripts at our website.	
	
	Terms of use:
	You are free to use this script as long as the copyright message is kept intact. However, you may not
	redistribute, sell or repost it without our permission.
	
	Thank you!
	
	www.dhtmlgoodies.com
	Alf Magne Kalleland
	
	************************************************************************************************************/	
	var arrayOfRolloverClasses = new Array();
	var arrayOfClickClasses = new Array();
	var activeRow = false;
	var activeRowClickArray = new Array();
	
	function highlightTableRow()
	{
		var tableObj = this.parentNode;
		if(tableObj.tagName!='TABLE')tableObj = tableObj.parentNode;

		if(this!=activeRow){
			this.setAttribute('origCl',this.className);
			this.origCl = this.className;
		}
		this.className = arrayOfRolloverClasses[tableObj.id];
		
		activeRow = this;
		
	}
	
	function clickOnTableRow()
	{
		var tableObj = this.parentNode;
		if(tableObj.tagName!='TABLE')tableObj = tableObj.parentNode;		
		
		if(activeRowClickArray[tableObj.id] && this!=activeRowClickArray[tableObj.id]){
			activeRowClickArray[tableObj.id].className='';
		}
		this.className = arrayOfClickClasses[tableObj.id];
		
		activeRowClickArray[tableObj.id] = this;
				
	}
	
	function resetRowStyle()
	{
		var tableObj = this.parentNode;
		if(tableObj.tagName!='TABLE')tableObj = tableObj.parentNode;

		if(activeRowClickArray[tableObj.id] && this==activeRowClickArray[tableObj.id]){
			this.className = arrayOfClickClasses[tableObj.id];
			return;	
		}
		
		var origCl = this.getAttribute('origCl');
		if(!origCl)origCl = this.origCl;
		this.className=origCl;
		
	}
		
	function addTableRolloverEffect(tableId,whichClass,whichClassOnClick)
	{
		arrayOfRolloverClasses[tableId] = whichClass;
		arrayOfClickClasses[tableId] = whichClassOnClick;
		
		var tableObj = document.getElementById(tableId);
		var tBody = tableObj.getElementsByTagName('TBODY');
		if(tBody){
			var rows = tBody[0].getElementsByTagName('TR');
		}else{
			var rows = tableObj.getElementsByTagName('TR');
		}
		for(var no=0;no<rows.length;no++){
			rows[no].onmouseover = highlightTableRow;
			rows[no].onmouseout = resetRowStyle;
			
			if(whichClassOnClick){
				rows[no].onclick = clickOnTableRow;	
			}
		}
		
	}
	</script>	




    </head>
    <body>
    

<%
  String mensaje = (String) request.getAttribute("mensaje");
  Usuario usuario = (Usuario) request.getSession().getAttribute("usuarioObjeto");
  if (mensaje != null)
  {
	%>
	<h2><%=mensaje %> </h2>
	<%
  }
%>    

    <h1> Menu Principal</h1>
    
<%
if (usuario.esSysAdmin())
{
%>        
  
  <table id="menu" border=3>
   <tr><td>    <a href="DMController?op=ListarUsuarios&limitado=false">Listar Usuarios (incluye Sysop))</a> </td></tr>
   <tr><td>     <a href="DMController?op=ListarUsuarios&limitado=true"> Listar Usuarios</a> </td></tr>
   <tr><td>     <a href="DMController?op=ListarSectores">Listar Sectores</a> </td></tr>
   <tr><td>     <a href="DMController?op=SubirArchivo1">Ejemplo de subida y bajada de archivo</a> </td></tr>
   <tr><td>     <a href="DMController?op=AgregarNovedad1">Generar Novedad</a>  </td></tr>
   <tr><td>     <a href="DMController?op=ConsultarNovedades">Consultar Novedades</a>  </td></tr>
   <tr><td> 	<a href="DMController?op=ListarRoles">Listar y Modificar Roles</a>  </td></tr>
   <tr><td> 	<a href="DMController?op=ConsultarDocumento1">Consultar documento</a> </td></tr>
   <tr><td>     <a href="DMController?op=AgregarDocumento1">Agregar Documento</a> </td></tr>
   <tr><td>     <a href="DMController?op=Logout">Salir del sistema</a> </td></tr>
  </table>
  <script type="text/javascript">
addTableRolloverEffect('menu','tableRollOverEffect1','tableRowClickEffect1');
</script>
  
  
  
<% 
}
else if(usuario.esCGC())
{
%>
  <table id="menu" border=3>
   <tr><td>     <a href="DMController?op=ListarUsuarios&limitado=true"> Listar Usuarios</a> </td></tr>
   <tr><td>     <a href="DMController?op=ListarSectores">Listar Sectores</a> </td></tr>
   <tr><td>     <a href="DMController?op=AgregarNovedad1">Generar Novedad</a>  </td></tr>
   <tr><td>     <a href="DMController?op=ConsultarNovedades">Consultar Novedades</a>  </td></tr>
   <tr><td> 	<a href="DMController?op=ConsultarDocumento1">Consulta de un documento</a> </td></tr>
   <tr><td>     <a href="DMController?op=AgregarDocumento1">Agregar Documento</a> </td></tr>
   <tr><td>     <a href="DMController?op=Logout">Salir del sistema</a> </td></tr>
  </table>
  <script type="text/javascript">
addTableRolloverEffect('menu','tableRollOverEffect1','tableRowClickEffect1');
</script>
  

<%
}
else if(usuario.esOperario())
{
%>
  <table id="menu" border=3>
   <tr><td>     <a href="DMController?op=ConsultarNovedades">Consultar Novedades</a>  </td></tr>
   <tr><td> 	<a href="DMController?op=ConsultarDocumento1">Consulta de un documento</a> </td></tr>
   <tr><td>     <a href="DMController?op=Logout">Salir del sistema</a> </td></tr>
  </table>
  <script type="text/javascript">
addTableRolloverEffect('menu','tableRollOverEffect1','tableRowClickEffect1');
</script>
  
<% 
}
else if(usuario.esIntermedio())
{
%>
  <table id="menu" border=3>
   <tr><td>     <a href="DMController?op=ConsultarNovedades">Consultar Novedades</a>  </td></tr>
   <tr><td>     <a href="DMController?op=Logout">Salir del sistema</a> </td></tr>
  </table>
  <script type="text/javascript">
addTableRolloverEffect('menu','tableRollOverEffect1','tableRowClickEffect1');
</script>
<% 
}
%>  
    
    </body>
</html>
